package test;
import static org.junit.Assert.assertTrue;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import expression.InfixtoPostfixTranslator;

public class AmandaWebsterIPTest {

	@Before
	public void setUp() {
	}

	@After
	public void tearDown() {
	}

	@Test
	public void test() {
		String answer = InfixtoPostfixTranslator.eval("1 + 4");
		assertTrue(answer.equals("1 4 +"));
		
		answer = InfixtoPostfixTranslator.eval("5 + 7 + 1");  
		assertTrue(answer.equals("5 7 + 1 +"));
		
		answer = InfixtoPostfixTranslator.eval(" 1 - 4");
		assertTrue(answer.equals("1 4 -"));
		
		answer = InfixtoPostfixTranslator.eval("4 * 5 / 2");
		assertTrue(answer.equals("4 5 * 2 /"));
		
		answer = InfixtoPostfixTranslator.eval("( 3 * 7 ) / 3");
		assertTrue(answer.equals("3 7 * 3 /"));
		
		answer = InfixtoPostfixTranslator.eval("( 7 / 2 ) * 4");
		assertTrue(answer.equals("7 2 / 4 *"));
	}
}
